<template>
  <div>
    <el-dialog
      :visible="true"
      :title="title"
      class="add_case_dialog"
      width="60%"
      :before-close="callOf"
    >
      <el-table
        ref="tasklogform"
        v-loading="listLoading"
        :header-cell-style="{ background: 'dodgerblue', color: '#eeeeee' }"
        :data="list"
        border
        fit
        highlight-current-row
        style="width: 100%;"
        @sort-change="sortChange"
      >
        <el-table-column label="序号" width="100px" align="center">
          <template slot-scope="scope">{{ scope.$index + 1 }}</template>
        </el-table-column>
        <el-table-column label="bug_id" align="center">
          <template slot-scope="{ row }">
            <span>{{ row.bug_id }}</span>
          </template>
        </el-table-column>
        <el-table-column label="bug_姓名" align="center">
          <template slot-scope="{ row }">
            <span>{{ row.bug_name }}</span>
          </template>
        </el-table-column>
        <el-table-column label="bug_标题" align="center">
          <template slot-scope="{ row }">
            <span>{{ row.bug_title }}</span>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>
<script>

export default {
  name: 'BugReopenetailed',
  props: {
    // dialogAdd: Boolean,
    sizeForms: {
      type: Array,
      required: true
    },
    title: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      listLoading: true,
      list: null
    }
  },
  watch: {
    sizeForms() {
      this.list = this.sizeForms
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    // dialogFormAdd(form) {
    // },
    sortChange(data) {
      const { prop, order } = data
      if (prop === 'id') {
        this.sortByID(order)
      }
    },
    callOf() {
      this.$emit('closePop')
    },
    getSortClass: function(key) {
      const sort = this.listQuery.sort
      return sort === `+${key}` ? 'ascending' : 'descending'
    },
    getList(e) {
      // this.$emit("changeLogList", e);
      // this.listQuery = { ...this.listQuery, ...this.sizeForms };
      // this.listLoading = true;
      this.list = this.listQuery
      setTimeout(() => {
        this.listLoading = false
      }, 0.1 * 1000)
    }
  }
}
</script>
